<template>
  <section class="fact-one">
    <div class="container">
      <div class="block-title text-center">
        <h2 class="block-title__title">师资队伍 / 专业建设</h2><!-- /.block-title__title -->
      </div><!-- /.block-title -->
      <div class="row">
        <div class="col-lg-3 col-md-6 col-sm-12 wow fadeInUp" data-wow-duration="1500ms">
          <div class="fact-one__single">
            <div class="fact-one__inner">
              <h3 class="fact-one__count counter">{{ count1 }}</h3><!-- /.fact-one__count counter -->
              <p class="fact-one__text">教授数量</p><!-- /.fact-one__text -->
            </div><!-- /.fact-one__inner -->
          </div><!-- /.fact-one__single -->
        </div><!-- /.col-lg-3 col-md-6 col-sm-12 -->
        <div class="col-lg-3 col-md-6 col-sm-12 wow fadeInUp" data-wow-duration="1500ms">
          <div class="fact-one__single">
            <div class="fact-one__inner">
              <h3 class="fact-one__count counter">{{ count2 }}</h3><!-- /.fact-one__count counter -->
              <p class="fact-one__text">科研项目</p><!-- /.fact-one__text -->
            </div><!-- /.fact-one__inner -->
          </div><!-- /.fact-one__single -->
        </div><!-- /.col-lg-3 col-md-6 col-sm-12 -->
        <div class="col-lg-3 col-md-6 col-sm-12 wow fadeInUp" data-wow-duration="1500ms">
          <div class="fact-one__single">
            <div class="fact-one__inner">
              <h3 class="fact-one__count counter">{{ count3 }}</h3><!-- /.fact-one__count counter -->
              <p class="fact-one__text">学术带头人</p><!-- /.fact-one__text -->
            </div><!-- /.fact-one__inner -->
          </div><!-- /.fact-one__single -->
        </div><!-- /.col-lg-3 col-md-6 col-sm-12 -->
        <div class="col-lg-3 col-md-6 col-sm-12 wow fadeInUp" data-wow-duration="1500ms">
          <div class="fact-one__single">
            <div class="fact-one__inner">
              <h3 class="fact-one__count counter">{{ count4 }}</h3><!-- /.fact-one__count counter -->
              <p class="fact-one__text">技能大赛获奖</p><!-- /.fact-one__text -->
            </div><!-- /.fact-one__inner -->
          </div><!-- /.fact-one__single -->
        </div><!-- /.col-lg-3 col-md-6 col-sm-12 -->
      </div><!-- /.row -->
    </div><!-- /.container -->
  </section>
</template>

<script>
import apis from '../apis/apis';

export default {
  name: "Counter",
  data(){
    return{
      count1:0,
      count2:0,
      count3:0,
      count4:0,
    }
  },
  methods: {
    getValue() {
      apis.getValue("counter1_num").then(res => {
        this.count1 = res.value
      }).then(res=>{
        apis.getValue("counter2_num").then(res => {
          this.count2 = res.value
        })
      }).then(res=>{
        apis.getValue("counter3_num").then(res => {
          this.count3 = res.value
        })
      }).then(res=>{
        apis.getValue("counter4_num").then(res => {
          this.count4 = res.value
          this.$nextTick(() => {
            this.initCount()
          })
        })
      })
    },
    initCount() {
      if ($('.counter').length) {
        $('.counter').counterUp({
          delay: 10,
          time: 3000
        });
      }
    }
  },

}
</script>

<style scoped>

</style>
